/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.banco.db;

import br.com.banco.dao.BancoDBManager;
import java.sql.Connection;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 * Essa classe foi criada para que eu possa trabalhar com um banco no linux.
 * Não consegui instalar o MySQL ou o Postgre.
 * @author kaue-adm
 */
public class CreateBancoDb {

    private Connection conexao;

    public CreateBancoDb() {
        try {
            this.conexao = new BancoDBManager().obterConexaoJavaDb();
        } catch (Exception ex) {
            Logger.getLogger(CreateBancoDb.class.getName()).log(Level.SEVERE, null, ex);
        }

    }

    public void createUsuarioTable() {
        String sql = "CREATE table BANCO.USUARIO (" +
                "ID          INTEGER NOT NULL " +
                "PRIMARY KEY GENERATED ALWAYS AS IDENTITY " +
                "(START WITH 1, INCREMENT BY 1)," +
                "NOME    VARCHAR(255), " +
                "SENHA   VARCHAR(255)," +
                "NIVEL  VARCHAR(255)";
    }

    public void populateUsuarioTable() {
        String sql = "";

    }

    public void createContaTable() {
        String sql = "CREATE table BANCO.USUARIO (" +
                "ID          INTEGER NOT NULL " +
                "PRIMARY KEY GENERATED ALWAYS AS IDENTITY " +
                "(START WITH 1, INCREMENT BY 1)," +
                "NOME    VARCHAR(255), " +
                "SENHA   VARCHAR(255)," +
                "NIVEL  VARCHAR(255)";
    }

    public static void main(String[] args) {
        final CreateBancoDb creator = new CreateBancoDb();
        creator.createContaTable();
        creator.createUsuarioTable();
    }
}
